package sk.stuba.fiit.repka.dp.owl;

import java.util.ArrayList;
import java.util.List;

public class OWLComponent {
	private String name;
	private List<OWLComponent> subComponents;
	
	public OWLComponent(String name) {
		this.name = name;
	}
	
	public OWLComponent(String name, OWLComponent subComponent) {
		this.name = name;
		this.getSubComponents().add(subComponent);
	}
	
	public List<OWLComponent> getSubComponents() {
		if(this.subComponents == null) {
			this.subComponents = new ArrayList<OWLComponent>();
		}
		
		return this.subComponents;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public boolean hasSubComponent() {
		if(this.subComponents != null && this.subComponents.size() > 0) {
			return true;
		}
		return false;
	}
}
